package com.example.cushion.realize.frame.menu;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.cushion.R;
import com.example.cushion.base.BaseFragment;
import com.example.cushion.realize.setting.SettingFragment;

import org.itzheng.and.baseutils.ui.FragmentUtils;
import org.itzheng.and.baseutils.ui.UIUtils;

/**
 * Created by root on 17-5-7.
 */

public class MenuFragment extends BaseFragment {
    private View rootView;

    public static MenuFragment newFragment() {
        return new MenuFragment();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (rootView == null) {
            rootView = UIUtils.inflate(R.layout.fragment_menu);
            initFragment();
        }
        return rootView;
    }

    private void initFragment() {
        FragmentUtils.addFragmentToView(getFragmentManager().beginTransaction(),
                R.id.flSettingContent, SettingFragment.newFragment());
    }
}
